Skip to main content

Full text of "Arduino"

See other formats

Musical Glove 


Make Projects 

build, hack, tweak, share, discover,^ 

Musical Glove 

Written By: Stephanie 


Any computer w/ internet (1) 
Tape/glue (1) 


Arduino microcontroller, Uno or 
Duemilanove (1) 

Piezoelectric speaker (1) 

jumper cables (many) 

Small Breadboard (1) 


Push Button. 33mm (4-6) 

USB cabled) 

1 0K ohm Resistors (4-6) 

arduino extender cables (4-6) 

Adafruit Wave Shield for Arduino board- 





This tutorial will give you step-by-step instructions to make your own musical glove that wil 
produce a different note for each finger pushed. 

© Make Projects 

Page 1 of 5 

Musical Glove 

Step 1 — Musical Glove 


3VJW W» 

g w — 




• Start by gathering all materials listed under Tools & Parts. We will begin by getting one 
button to produce noise! 

• Assemble breadboard and Arduino for one button using the circuit diagram to the left. 

• Although not shown in the diagram, instead of attaching the button directly to the board, 
connect it to one end of an extender cable. Then attach the other end of the cable to the 
board. This way you can put the button in the glove later. (See picture.) 

Step 2 


sketch|^,dec03b | Arduino 1.0.2 

• Insert the code from "Musical 
Glove Code 1" document (found in 
the Files section at the top of this 
guide) into the Arduino IDE 
program and click the Upload 
button. At this point, if you push the 
button, the speaker should emit a 

• Save your work. 

© Make Projects 

Page 2 of 5 

Musical Glove 

Step 3 

m , 

m " 

1 1 i 

t 1 

// nfl 

— RSI £HJ 

ArtJuino » 




— At W 

r "1 

*5 » 





1 -^ 

• Set up the breadboard for the rest of the buttons. The code supports up to five buttons. If 
you want to add more, follow the instructions on the subsequent line, if not, then move onto 
the next page. 

• Set up another button on the breadboard exactly as the others were set up, only connect 
this one to analog pin 6. (Any additional buttons will connect to analog pin 7, then 8, etc. 
The same concept should also be applied to all subsequent steps.) Add the following code 
to your current code. 

• int sensorsix = anaiogRead (A5 ) ; This sets the sensor to its corresponding analog 
pin. Label each additional sensor with a new name and anaiogRead pin; e.g., the code for 

Sensor seven WOUld be sensor seven = anaiogRead (A6) ;. 

• Serial . println ( sensorsix ) ; int thisPitch6 = map( sensorsix, 0, 1023, 

400 , 200 ) ; This sets the sensor to a defined pitch. To change the pitch, change the last 
value after the map function (currently 200). The higher the number, the higher the pitch, 
and vice versa. 

• if (sensorsix > threshold) { tone(9, thisPitch6, 20); } If the reading 

from the sensor is greater than the threshold value (as when the button is pushed), then 
the speaker will emit a tone. 

© Make Projects 

Page 3 of 5 

Musical Glove 

Step 4 

• If all this is done correctly, the speaker should emit a tone for every button that is pushed. 
If not, go back to steps 1-3 and double-check the code and your physical setup. 

• If it is working, assemble the glove! 

• Cut holes into the fingers of the glove, or wherever you want a button to go. 

• Insert buttons and secure with tape, glue or thread. 

• Secure the extender cables with tape or glue. 

• Enjoy your new musical instrument! 

© Make Projects 

Page 4 of 5 

Musical Glove 

Step 5 

• If you want to take it a step further and have the glove emit noises other than simple tones, 
then I'd recommend buying an Adafruit Wave Shield for Arduino board- v1.1. This board 
will allow you to record and upload different noises to your glove! 

• You can stack the shield directly on top of the Arduino, but what I did was to connect the 
needed pins by using extender cables. It's messy, but it's quick and easy. (See pictures to 
the left to see just how messy it gets! You've been warned.) 

• For more information, click the following links: OVERVIEW. BUY . CODE . FAQ 

This document was last generated on 2013-02-15 07:44:32 AM. 

© Make Projects 

Page 5 of 5